#include <stdio.h>
#include <ctype.h>

#define MAX_LEN 80

int main() {
	char sentence[MAX_LEN] = { 0 };
	char ch;
	int index = 0, shift;

	printf("Enter message to be encrypted: ");
	while ((ch = getchar()) != '\n' && index < MAX_LEN)
	{
		sentence[index++] = ch;
	}

	printf("Enter shift amount (1-25): ");
	scanf("%d", &shift);

	printf("Encrypted message: ");
	for (int i = 0; i < index; i++)
	{
		ch = sentence[i];
		if (isupper(ch))
		{
			ch = ((ch - 'A') + shift) % 26 + 'A';
		}
		else if (islower(ch)) {
			ch = ((ch - 'a') + shift) % 26 + 'a';
		}

		putchar(ch);
	}

	putchar('\n');
	return 0;
}